<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:p="http://xmlns.jcp.org/jsf/passthrough"
	xmlns:mywidgets="http://xmlns.jcp.org/jsf/composite/widgets"
>
<ui:composition
	xmlns:mywidgets="http://xmlns.jcp.org/jsf/composite/widgets"
>
	<div id="fixNavigationButton">
		<div id="navIconDiv">
			<h:graphicImage value="/resources/media/icons/menuWhite.png"
				border="0" width="24" height="24" alt="Menu Navigation Icon"
			/>
			<h:graphicImage class="navIconHide"
				value="/resources/media/icons/menu.png" border="0" width="24"
				height="24" alt="Menu Navigation Icon"
			/>
		</div>
		<h:link outcome="/splitter">
			<div id="logoText" class="logoTextClosed">
				<div id="logoZ">Z</div>
				<div id="logoB" class="logoBClosed">B</div>
			</div>
		</h:link>
		<ui:remove>
			<h:link outcome="/index">
				<h:graphicImage id="logoImage"
					value="/resources/media/brayancomlogo.png" border="0"
					alt="Welcome to brayan.com"
				/>
			</h:link>
		</ui:remove>
	</div>
	<nav id="slideNav">
	
		<h:panelGroup id="slideNavGroup">
	
			<h:panelGroup layout="block" id="loginPanel">
			
				<h:panelGroup layout="block" rendered="#{!loginController.loggedIn}">
					<h:form style="text-align: left;">
						<h:inputText value="#{loginController.username}" required="true" requiredMessage="#{i18N.getTrans('ProvideUsername')}" styleClass="usernameIcon" p:placeholder="#{i18N.getTrans('youremail')}" />
						<h:inputSecret value="#{loginController.password}" required="true" requiredMessage="#{i18N.getTrans('ProvidePassword')}" styleClass="passwordIcon" p:placeholder="#{i18N.getTrans('password')}"/>
						<h:commandButton value="#{i18N.getTrans('Login')}" action="#{loginController.login}">
							<f:ajax execute="@form" render="slideNavGroup" />
						</h:commandButton>
						<br/>
						<h:link outcome="/registration" value="#{i18N.getTrans('Btn:RegisterAccount')}" title="#{i18N.getTrans('BtnTitle:RegisterAccount')}" />
						
					</h:form>
				</h:panelGroup> 
				
				<h:panelGroup layout="block" rendered="#{loginController.loggedIn}">
					<h:form style="text-align: left;">
					<h:commandLink action="#{loginController.logout()}" value="">
						<f:ajax execute="@form" render="slideNavGroup" />
						<h:graphicImage value="/resources/media/icons/32/basic2-010.png" title="#{i18N.getTrans('Logout')}" />
					</h:commandLink>
					</h:form>	
				</h:panelGroup>
				<br/>
				<h:messages layout="table" infoClass="infoClass" warnClass="warnClass" errorClass="errorClass" />
				
			</h:panelGroup>
			
			<hr/>
			
			<h:panelGroup layout="block" id="sideMenu">	
			
				<h:panelGroup layout="block"  rendered="#{loginController.admin}">
					<h:link class="sideMenuLink" outcome="/admin/admin">Admin</h:link>			
				</h:panelGroup>		
				
				<h:panelGroup layout="block" >
					<h:link class="sideMenuLink" outcome="/realestate/calendar">#{i18N.getTrans('Calendar')}</h:link>
				</h:panelGroup>
				
				<h:panelGroup layout="block" rendered="#{loginController.loggedIn}">
					<h:link class="sideMenuLink" outcome="/realestate/reservations">#{i18N.getTrans('MyReservations')}</h:link>
				</h:panelGroup>
				
			</h:panelGroup>
			
			<hr/>
			
			<h:form>
				<h:selectOneMenu id="countryCode" value="#{localeController.id}"
					valueChangeListener="#{i18N.localeChanged}" onchange="submit()"
				>
					<f:selectItem itemValue="" itemLabel="#{i18N.getTrans('YourLanguage:')} #{i18N.locale.language.nativeLanguageName} (#{i18N.locale.localeCode})" />
					<f:selectItems value="#{localeController.getAllLocalesExcept(i18N.locale.localeCode)}" var="locale"
						itemLabel="#{locale.language.nativeLanguageName}, (#{locale.localeCode})"
						itemValue="#{locale.id}"
					/>
				</h:selectOneMenu>
			</h:form>
			
			
				<ui:remove>
				
				<hr/>
					<div id="headerLocationElement"
						title="This is a location service. It alerts if there's a chance to meet up with Brayan."
					>Hook up with Brayan for a get-together. Accept your browsers
						location service.</div>
				</ui:remove>
			</h:panelGroup>
	</nav>
</ui:composition>
</html>
